Read or write start value(s) from variables or complete data blocks
| LGF_StartValueReadWrite (FB) | ||||||||
|---|---|---|---|---|---|---|---|---|
| Bool | read | readDone | Bool | |||||
| Bool | write | writeDone | Bool | |||||
| Variant | dataSource | busy | Bool | |||||
| Variant | dataDestination | error | Bool | |||||
| lastRead | DTL | |||||||
| lastWrite | DTL | |||||||
| status | Word | |||||||
| diagnostics | LGF_typeDiagnostics | |||||||
| Identifier | Data type | Default value | Description |
|---|---|---|---|
| read | Bool | FALSE | Rising edge: Read start value of data block / Variable of data block |
| write | Bool | FALSE | Rising edge: Write actual value(s) to start value of data block / Variable of data block |
| dataSource | Variant | --- | Data (block / variable) source, if a separate source is needed. May also be `NULL` - then the target is also used as the source |
| dataDestination | Variant | --- | Data (block / variable) destination |
| Identifier | Data type | Description |
|---|---|---|
| readDone | Bool | TRUE: Read has been completed successfully |
| writeDone | Bool | TRUE: Write has been completed successfully |
| busy | Bool | TRUE: FB is not finished and new output values can be expected |
| error | Bool | TRUE: An error occurred during the execution of the FB |
| lastRead | DTL | Timestamp of last read access |
| lastWrite | DTL | Timestamp of last write access |
| status | Word | 16#0000 - 16#7FFF: Status of the FB, 16#8000 - 16#FFFF: Error identification |
| diagnostics | LGF_typeDiagnostics | Diagnostic information |
| Code / Value | Identifier / Description |
|---|---|
| 16#0001 | STATUS_READ_DONE Read execution finished without errors |
| 16#0002 | STATUS_WRITE_DONE Write execution finished without errors |
| 16#7000 | STATUS_NO_CALL No job being currently processed |
| 16#7001 | STATUS_READ Read value(s) in progress |
| 16#7002 | STATUS_WRITE Write value(s) in progress |
| 16#8400 | ERR_MULTIPLE_COMMANDS Error: Multiple commands add the same time not allowed. |
| 16#8600 | ERR_UNDEFINED_STATE Error: Undefined state in state machine |
| 16#8601 | ERR_READ Error: Read value(s) `READ_DBL` - see `diagnostics.subfunctionStatus` |
| 16#8602 | ERR_WRITE Error: Write value(s) `WRITE_DBL` - see `diagnostics.subfunctionStatus` |
| 16#8611 | ERR_READ_TIME Error: Read timestamp `RD_LOC_T` while read values - see `diagnostics.subfunctionStatus` |
| 16#8612 | ERR_WRITE_TIME Error: Write timestamp `WR_LOC_T` while write values - see `diagnostics.subfunctionStatus` |
Diagnostic structure to store and transfer diagnostic information from blocks through the interface.
| Identifier | Data type | Default value | Description |
|---|---|---|---|
| status | Word | 16#0000 | Status of the Block or error identification when error occurred |
| subfunctionStatus | Word | 16#0000 | Status or return value of called FB's, FC's and system blocks |
| stateNumber | DInt | 0 | State in the state machine of the block where the error occurred |
The function reads or writes the start value of a single variable, a structured variable or an entire data area or data block from the source to the destination.
The parameter dataDestination must always be present, the parameter dataSource is optional.
If dataSource is not used, the function...
The possibilities are, for example:
| Version & Date | Change description | |
|---|---|---|
| 1.0.0 | Simatic Systems Support | |
| 2025-05-05 | First released version | |